import request from '@/utils/request'

// 查询trading列表
export function listTrading(query) {
  return request({
    url: '/onlineShop/trading/list',
    method: 'get',
    params: query
  })
}
// 查询个人trading列表
export function myListTrading(query) {
  return request({
    url: '/onlineShop/trading/myList',
    method: 'get',
    params: query
  })
}
// 查询个人trading数量
export function myTradings(query) {
  return request({
    url: '/onlineShop/trading/myTradings',
    method: 'get',
    params: query
  })
}

// 查询trading详细
export function getTrading(id) {
  return request({
    url: '/onlineShop/trading/' + id,
    method: 'get'
  })
}
// 查询trading详细
export function tradingAuction(id) {
  return request({
    url: '/onlineShop/trading/tradingAuction/' + id,
    method: 'get'
  })
}

// 新增trading
export function addTrading(data) {
  return request({
    url: '/onlineShop/trading',
    method: 'post',
    data: data
  })
}

// 修改trading
export function updateTrading(data) {
  return request({
    url: '/onlineShop/trading',
    method: 'put',
    data: data
  })
}

// 删除trading
export function delTrading(id) {
  return request({
    url: '/onlineShop/trading/' + id,
    method: 'delete'
  })
}
